<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
        <!-- <a style="float: right;margin-right: 12%;margin-top: -10px;"
           has-permission permission='forum.forumPost.add' ui-sref="main.forum.forumPost.add" class="btn btn-sm btn-info">
            <i class="icon-tag m-r-sm text-md"></i>添加帖子</a> -->
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-body">
                <form ng-submit="searchRe()" class="form-horizontal">
                    <div class="form-group">
                    	<div class="col-sm-2">
                            <select class="form-control" ng-model="searchParams.channelNo"
                                    ng-options="d.channelNo as d.channelName for d in channelList" id="channelNo">
                                <option value="">--频道--</option>
                            </select>
                        </div>

                        <!-- <div class="col-sm-2">
                            <input type="text" class="form-control" ng-model="searchParams.id" id="id" placeholder="帖子ID">
                        </div> -->
                        
                        <div class="col-sm-2">
                            <input type="text" class="form-control" ng-model="searchParams.title" id="title" placeholder="标题">
                        </div>
                        
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="searchParams.enable" style="color: black" id="enable" name="enable" >
                                <option value="">--是否可用--</option>
                                <option value="Y">可用</option>
                                <option value="N">不可用</option>
                            </select>
                        </div>
                        
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="searchParams.isRecommend" style="color: black" id="isRecommend" name="isRecommend" >
                                <option value="">--是否推荐--</option>
                                <option value="Y">推荐</option>
                                <option value="N">不推荐</option>
                            </select>
                        </div>
                        
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="searchParams.isTop" style="color: black" id="isTop" name="isTop" >
                                <option value="">--是否置顶--</option>
                                <option value="Y">是</option>
                                <option value="N">否</option>
                            </select>
                        </div>
                        
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="searchParams.status" style="color: black" id="status" name="status" >
                                <option value="">--帖子状态--</option>
                                <option value="1">审核中</option>
                                <option value="2">初审通过</option>
                                <option value="3">初审拒绝</option>
                                <option value="4">复核通过</option>
                                <option value="5">复核拒绝</option>
                                <option value="6">作废</option>
                            </select>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="searchParams.labelNo"
                                    ng-options="d.labelNo as d.labelName for d in labelList" id="labelNo">
                                <option value="">--帖子标签--</option>
                            </select>
                        </div>
                        <div class="col-sm-2">
                            <select class="form-control" ng-model="searchParams.configNo"
                                    ng-options="d.configNo as d.postType for d in postTypeList" id="configNo">
                                <option value="">--帖子类型--</option>
                            </select>
                        </div>
                        <div class="col-sm-2">
                            <input type="text" ng-model="searchParams.startTime" placeholder="开始日期"  id="startTime" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        
                        <div class="col-sm-2">
                            <input type="text" ng-model="searchParams.endTime" placeholder="结束日期"  id="endTime" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        
                        <div class="col-md-1">
                            <label class="col-sm-1"><button class="ifc-btn btn-primary"  type="submit">查 询</button></label>
                        </div>
                        
                        <div class="col-md-1">
                            <label class="col-sm-1"><button class="ifc-btn btn-dark" ng-click="clearSearch()" type="reset">清 空</button></label>
                        </div>
                        
                        <div class="col-md-1">
                            <label class="col-sm-1"><button class="ifc-btn btn-success" type="button" ng-click="isRecommend('', 'Y')" >批量推荐</button></label>
                        </div>
                        
                        <div class="col-md-1">
                            <label class="col-sm-1"><button class="ifc-btn btn-info" type="button" ng-click="isTop('', 'Y')" >批量置顶</button></label>
                        </div>
                    </div>
                </form>
            </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center sort" >
                    <thead>
                    <tr>
                    	<th><input type="checkbox" id="allCheck" ng-click="selectAll($event)"/>全选</th>
                        <th>序号</th>
                        <th>帖子ID</th>
                        <th>帖子标题</th>
                        <th>发帖人</th>
                        <th>频道</th>
                        <th>帖子标签</th>
                        <th>阅读量</th>
                        <th>虚拟阅读量</th>
                        <th>举报量</th>
                        <th>收藏量</th>
                        <th>点赞量</th>
                        <th>跟帖量</th>
                        <th>关注量</th>
                        <th>创建时间</th>
                        <th>是否可用</th>
                        <th>是否推荐</th>
                        <th>是否置顶</th>
                        <th>审核状态</th>
                        <th>帖子类型</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="platInfoList">
                    <tr ng-repeat="item in pageInfo.records">
                    	<td class="v-middle">
                            <input type="checkbox" name="selected" ng-checked="isSelected(item.id)" ng-click="updateSelection($event,item)"/>
                        </td>
                        <td class="v-middle">{{$index + 1}}</td>
                        <td class="v-middle">{{item.id}}</td>
                        <td class="v-middle">
                        	<a style="color: green" ng-if="item.title.length > 10" ng-mouseover="preview(item.title)" ng-mouseout="outHide()" ng-click='hyzpostdetail(item.id)'>{{item.title | limitTo:6}}...</a>
                        	<a style="color: green" ng-if="item.title.length <= 10" ng-click='hyzpostdetail(item.id)'>{{item.title}}</a>
                        </td>
                        <td class="v-middle">{{item.userId}}</td>
                        <td class="v-middle">{{item.channelName}}</td>
                        <td class="v-middle">{{item.labelName}}</td>
                        <td class="v-middle">{{item.readCount}}</td>
                        <td class="v-middle">{{item.fictitiousReadCount*1+item.readCount*1}}</td>
                        <td class="v-middle">{{item.reportCount}}</td>
                        
                        <td class="v-middle">{{item.collectionCount}}</td>
                        <td class="v-middle">{{item.loveCount}}</td>
                        <td class="v-middle">{{item.followCount}}</td>
                        <td class="v-middle">{{item.attentionCount}}</td>
                        
                        <td class="v-middle">{{item.createTime | date:'yyyy-MM-dd HH:mm:ss'}}<br/>{{item.publishTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
						<td class="v-middle">
                        	<span ng-if="item.enable=='Y'">可用</span>
                            <span ng-if="item.enable=='N'">不可用</span>
                        </td>
                        
                        <td class="v-middle">
                        	<span ng-if="item.isRecommend=='Y'">推荐</span>
                            <span ng-if="item.isRecommend=='N'">不推荐</span>
                        </td>
                        
                        <td class="v-middle">
                        	<span ng-if="item.isTop=='Y'">是</span>
                            <span ng-if="item.isTop=='N'">否</span>
                        </td>
                        
                        <td class="v-middle">
                        	<span ng-if="item.status=='1'">审核中</span>
                            <span ng-if="item.status=='2'">初审通过</span>
                            <span ng-if="item.status=='3'">初审拒绝</span>
                            <span ng-if="item.status=='4'">复核通过</span>
                            <span ng-if="item.status=='5'">复核拒绝</span>
                            <span ng-if="item.status=='6'">作废</span>
                        </td>
                        <td class="v-middle">{{item.postType}}</td>
                        <td class="v-middle">
                        	<!-- <a ui-sref="main.forum.forumPost.detail({id: item.messageId})" class="btn btn-sm btn-default">
                                <i class="fa fa-info m-r-xs text-sm"></i>详情</a> -->
                                
                            <!-- <button type="button" ng-if="item.enable=='N'" ui-sref="main.forum.forumPost.update({id: item.id})" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-edit m-r-xs text-sm"></i>修改</button> -->
                        
                            <button type="button" ng-if="item.enable=='Y' && item.status != '6'" ng-click="enable(item.id,'N')" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-ban m-r-xs text-sm"></i>禁用</button>
                                
                            <button type="button" ng-if="item.enable=='N' && item.status != '6'" ng-click="enable(item.id,'Y')" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-check m-r-xs text-sm"></i>启用</button>
                                
                            <button type="button" ng-if="item.isRecommend=='N' && item.enable=='Y' && item.status=='4'" ng-click="isRecommend(item.id,'Y')" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-check m-r-xs text-sm"></i>推荐</button>
                                
                            <button type="button" ng-if="item.isRecommend=='Y' && item.status != '6'" ng-click="isRecommend(item.id,'N')" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-ban m-r-xs text-sm"></i>不推荐</button>
                                
                            <button type="button" ng-if="item.isTop=='N' && item.enable=='Y' && item.status=='4'" ng-click="isTop(item.id,'Y')" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-check m-r-xs text-sm"></i>置顶</button>
                                
                            <button type="button" ng-if="item.isTop=='Y' && item.status != '6'" ng-click="isTop(item.id,'N')" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-ban m-r-xs text-sm"></i>取消置顶</button>
                                
                            <a ng-click="addLabel(item.id)" ng-if="item.status != '6'" class="btn btn-sm btn-default">
								<i class="fa fa-edit m-r-xs text-sm"></i>添加标签</a>
								
							<a ng-click="selectLabel(item.id)" ng-if="item.status != '6'" class="btn btn-sm btn-default">
								<i class="fa fa-info m-r-xs text-sm"></i>查看已添加的标签</a>
							
                        </td>

                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

			<div class="cover" ng-show="firstApply" >
				<div class="firstApplyWrap noselect" style="overflow-y:scroll">
				    <div class="clear">
				        <i style="float: right; margin-top: 5px; margin-right: 5px; cursor: pointer; color:#ccc; font-size: 30px;" class=" iconfont closeBtn noselect" ng-click="firstApply=false">&#xe608;</i>
				    </div>
				    <div class="title" >
				        <div class="row"  >
				            <div class="col-sm-3 text-left">标签类型:</div>
				            <div class="col-sm-3 text-left" >
				                <input type="checkbox" ng-model="selectAll1" ng-click="all(selectAll1)"> 全选 </div>
				            <br>
				            <div ng-repeat="items in pageInfos.records" style="color:#a94442;text-align:left;white-space:nowrap;padding:18px 86px 0 130px;">
				                <input type="checkbox" ng-model="state" id="state" class="checkitem" name="targetDeviceTypes" ng-checked="selectAll1" value="{{items.labelNo}}">{{items.labelName}}
				            </div>
				         </div>
				     <div class="modal-footer">
				         <button type="button" class="btn btn-default" ng-click="firstApply=false">取消</button>
				         <button type="button" class="btn btn-primary"  ng-click="saveMakeUp(id)">确定</button>
				     </div>
				     </div>
				 </div>
            </div>

            <!--用于显示内容的样式-->
            <div id="showDiv" style="position: fixed; background-color: black; border: 0px solid black;color: yellow"></div>

            <!--用于显示内容的样式-->
            <div id="showDiv1" style="position: fixed; background-color: black; border: 0px solid black;color: yellow"></div>

            <!-- 底部分页 -->
            <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->

</div><!-- /.wrapper-md -->
<!--点击预览-->

<div class="cover" ng-show="firstApply1" >
    <div class="firstApplyWrap1" style="overflow-y:scroll">
        <div class="clear"><i style="float: right; margin-top: 5px; margin-right: 5px; cursor: pointer; color:#ccc; font-size: 30px;" class=" iconfont closeBtn noselect" ng-click="firstApply1=false">&#xe608;</i></div>
        <div class="title" >
            <div class="modal-header">
                <h4 class="modal-title" id="CashLabel" style="font-size: xx-large;text-align:center">已添加过的帖子标签展示</h4>
            </div>
            <div class="modal-body">

                <!-- 数据表格 -->
                <div class="table-responsive">
                    <table class="table table-striped b-t b-light text-center">
                        <thead>
                        <tr>
                            <!--<th>帖子标题</th>-->
                            <th style="font-size:large">标签名称</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="items in pageInfoAdd" style="color:green;">
                            <!--<td class="v-middle" title="{{items.title}}">{{items.title | limitTo:20}}</td>-->
                            <td class="v-middle" title="{{items.labelName}}">{{items.labelName}}</td>
                        </tr>
                        </tbody>
                    </table>
                </div><!-- /.table-responsive -->

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" ng-click="firstApply1=false" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<style>
    .cover {
        position: fixed;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 2000;
        top: 0;
        left: 0;
        /* display: none; */
    }

    .firstApplyWrap{
        width: 700px;
        height:500px;
        background: #f0f4f7;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        -webkit-transform: translate(-50%,-50%);
        -ms-transform: translate(-50%,-50%);
        -o-transform: translate(-50%,-50%);
        -moz-transform: translate(-50%,-50%);
        border-radius: 5px;
        overflow: hidden;
    }

    .firstApplyWrap1{
        width: 800px;
        height:500px;
        background: #fff;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        -webkit-transform: translate(-50%,-50%);
        -ms-transform: translate(-50%,-50%);
        -o-transform: translate(-50%,-50%);
        -moz-transform: translate(-50%,-50%);
        border-radius: 5px;
        overflow: hidden;
    }

    .firstApplyWrap .title{
        font-size: 18px;
        color:#333;
        padding:18px 86px 0 130px;
        text-align: center;
        line-height: 2em;
    }
    .firstApplyWrap .closeBtn,.finishData .closeBtn{
        font-size: 30px;
        padding:5px 20px 0 0;
        border-radius: 50%;
        color: #ccc;
        float: right;
        cursor: pointer;
    }
    .finishData .closeBtn{
        position: absolute;
        top:10px;
        right:10px;
    }
    .firstApplyWrap .bkgIcon{
        position: absolute;
        left: 54px;
        top:87px;
        font-size: 50px;
        color:#FFB136;
    }
    .firstApplyWrap .applyBtnWrap{
        position: absolute;
        bottom: -2px;
        width: 100%;
    }
    .firstApplyWrap .applyBtn{
        width: 50%;
        height:70px;
        line-height: 70px;
        background: #FFB135;
        font-size: 20px;
        text-align: center;
        color:#fff;
        cursor: pointer;
        float:left;
    }
    .firstApplyWrap .applyBtn:last-child{
        background: #5796FC;
    }


    .switch{
        display:none;
    }
    .switchlabel{
        position:relative;
        display: block;
        padding: 1px;
        border-radius: 24px;
        height: 22px;
        margin-bottom: 15px;
        background-color: #eee;
        cursor: pointer;
        vertical-align: top;
        -webkit-user-select: none;
    }
    .switchlabel:before{
        content: '';
        display: block;
        border-radius: 24px;
        height: 22px;
        background-color: #BFBFBF;
        -webkit-transform: scale(1, 1);
        -webkit-transition: all 0.3s ease;
    }
    .switchlabel:after{
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -11px;
        margin-left: -11px;
        width: 22px;
        height: 22px;
        border-radius: 22px;
        background-color: white;
        box-shadow: 1px 1px 1px 1px rgba(0,0,0,0.08);
        -webkit-transform: translateX(-9px);
        -webkit-transition: all 0.3s ease;
    }
    .switch:checked~label:after{
        -webkit-transform: translateX(9px);
    }
    .switch:checked~label:before{
        background-color:green;
    }
</style>